#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "LinkEndData.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// LinkEndDestructionData
/// LinkEndDestructionData is LinkEndData used to provide values for one end of a
/// link to be destroyed by a DestroyLinkAction.
/// </summary>
class UMLMODEL_EXPORT LinkEndDestructionData : public LinkEndData {

public: // Constructors and destructors
    explicit LinkEndDestructionData(const QString& umlType="uml::LinkEndDestructionData");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// allPins
    /// Adds the destroyAt InputPin (if any) to the set of all Pins.
    /// </summary>
    shared_ptr<vector<InputPin>> allPins() const override;

public: // Properties
    /// <summary>
    /// destroyAt getter
    /// The InputPin that provides the position of an existing link to be destroyed in
    /// an ordered, nonunique Association end. The type of the destroyAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero or unlimited.
    /// </summary>
    shared_ptr<InputPin> destroyAt() const;

    /// <summary>
    /// destroyAt setter
    /// The InputPin that provides the position of an existing link to be destroyed in
    /// an ordered, nonunique Association end. The type of the destroyAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero or unlimited.
    /// </summary>
    void setDestroyAt(shared_ptr<InputPin> value);

    /// <summary>
    /// isDestroyDuplicates getter
    /// Specifies whether to destroy duplicates of the value in nonunique Association
    /// ends.
    /// </summary>
    bool isDestroyDuplicates() const;

    /// <summary>
    /// isDestroyDuplicates setter
    /// Specifies whether to destroy duplicates of the value in nonunique Association
    /// ends.
    /// </summary>
    void setIsDestroyDuplicates(bool value);

private: // Fields
    /// <summary>
    /// destroyAt
    /// The InputPin that provides the position of an existing link to be destroyed in
    /// an ordered, nonunique Association end. The type of the destroyAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero or unlimited.
    /// </summary>
    shared_ptr<InputPin> destroyAt_;

    /// <summary>
    /// isDestroyDuplicates
    /// Specifies whether to destroy duplicates of the value in nonunique Association
    /// ends.
    /// </summary>
    const static bool isDestroyDuplicates_default_;
    bool isDestroyDuplicates_= isDestroyDuplicates_default_;

};

} // namespace uml
